package com.gangzi.liteormbyrxjava;

import com.litesuits.orm.db.annotation.Column;
import com.litesuits.orm.db.annotation.Default;
import com.litesuits.orm.db.annotation.NotNull;
import com.litesuits.orm.db.annotation.PrimaryKey;
import com.litesuits.orm.db.annotation.Table;
import com.litesuits.orm.db.annotation.Unique;
import com.litesuits.orm.db.enums.AssignType;

import java.io.Serializable;

/**
 * Created by 岗子博 on 2017/1/14.
 */
@Table("teacher")
public class TeacherBean implements Serializable {
    public static final String AGE="age";
    @PrimaryKey(AssignType.AUTO_INCREMENT)
    private int id;

    @Unique
    private String name;

    @Column(AGE)
    private int age;

    @Default("chuyi")
    public String class_name;

    @Default("true")   //默认值  save操作才有效果
    @NotNull
    public Boolean sex;


    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }


    public String getClass_name() {
        return class_name;
    }

    public void setClass_name(String class_name) {
        this.class_name = class_name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isSex() {
        return sex;
    }

    public void setSex(boolean sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "TeacherBean{" +
                "age=" + age +
                ", id=" + id +
                ", name='" + name + '\'' +
                ", class_name='" + class_name + '\'' +
                ", sex=" + sex +
                '}';
    }
}
